import akshare as ak
import sys
# 分析师详情
# analyst_id=”11000257131″; 分析师ID, 从 stock_em_analyst_rank 获取
# indicator=”最新跟踪成分股”; 从 {“最新跟踪成分股”, “历史跟踪成分股”, “历史指数”} 中选择一个


def stock_em_analyst_detail(code,url1):
    stock_em_analyst_detail = ak.stock_em_analyst_detail(analyst_id=code,indicator=url1)
    for indexs in stock_em_analyst_detail.index:
        s = ''
        index = stock_em_analyst_detail.loc[indexs]
        for i in range(index.size):
            s = s + str(index[i])
            if i != index.size - 1:
                s = s + ","
        print(s)



if __name__ == '__main__':
    url = sys.argv[0]
    url1 = sys.argv[1]
    stock_em_analyst_detail(url,url1)